package com.rajeshDyadav.pyramids;

public class PyramidTest {
    public static void main(String[] args) {

	int i, j, k;	
	char myChar = '*', mySpaceChar = ' ';

	for(i=0;i<5;i++) {
	    System.out.print(mySpaceChar);
	}
	System.out.print(myChar);
	System.out.println();
	
	for (j = 0; j < 5; j++) {
	    for (i = j; i < 4; i++) {
		System.out.print(mySpaceChar);
	    }
	    System.out.print(myChar);

	    for (i = 0; i <= (j*2); i++) {
		System.out.print(mySpaceChar);
	    }
	    System.out.print(myChar);

	    System.out.println();
	}

	for (j = 0; j < 4; j++) {
	    for (i = 0; i <= j; i++) {
		System.out.print(mySpaceChar);
	    }
	    System.out.print(myChar);

	    for(k=j;i>0;i--) {
		    System.out.print(mySpaceChar);
	    }
	    
	    System.out.println();
	}
	

    }
}
